Skip to content

Conversation

@gh-workflow-token-generator
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@team-plain/typescript-sdk@2.0.0

Major Changes

  • 39bc31b: Changed return type of upserting customer to include the upsert 'result' (e.g. if it the customer was created, updated or not modified). This means you will have to slight adjust your code to account for this.

    For example in the below code this would be the change you now have to make:

      const client = new PlainClient({ apiKey: '' });
    
      const res = await client.upsertCustomer({
        identifier: {
          customerId: '',
        },
        onCreate: {
          fullName: '',
          email: {
            email: '',
            isVerified: false,
          },
        },
        onUpdate: {},
      });
    
      if (res.error) {
        console.error(res.error);
        throw new Error(res.error.message);
      }
    
    -  console.log(`Created customer with id=${res.data.id}`);
    +  console.log(`Created customer with id=${res.data.customer.id}`);

Minor Changes

  • 39bc31b: Added a query to get the customer by their email (getCustomerByEmail) and the ability to send and reply to emails via sendNewEmail and replyToEmail respectively.

@vercel
Copy link

vercel bot commented Jun 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
typescript-sdk ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2023 8:36pm

@mattvagni mattvagni enabled auto-merge (squash) June 5, 2023 20:36
@mattvagni mattvagni merged commit 380ab9c into main Jun 5, 2023
@mattvagni mattvagni deleted the changeset-release/main branch June 5, 2023 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants